<template>
  <div class="news-detail">
    <TopInfo />
    <TopTabs />
    <div class="content">
      <div class="news-content">
        <div class="header-info">
          <p class="header-title">{{ newData.ProductName }}</p>
          <div class="header-content">
            <div class="content-info fl">
              <div>
                <i class="el-icon-s-platform"></i>来源：{{ newData.ProSource }}
              </div>
              <div>
                <i class="el-icon-timer"></i>申报：{{ newData.AppDate }}
              </div>
            </div>
            <!-- <div class="save fr">
              <i class="el-icon-star-off"></i>
            </div> -->
          </div>
        </div>
        <div class="bodyer-info">
          <div class="lefter-info fl">
            <p class="p-title">申请条件</p>
            <div v-html="newData.AppCondition"></div>
            <p class="p-title">支持力度</p>
            <div v-html="newData.SupportLv"></div>
            <p class="p-title">项目来源</p>
            <div class="test-info">{{ newData.ProSource }}</div>
            <a :href="newData.UrlSource" class="links" target="_blank">{{
              newData.UrlSource
            }}</a>
          </div>
          <div class="righter-info fr">
            <p class="p-title">热门匹配</p>
            <ul class="news-list">
              <li
                @click="ToResourceDetail(item)"
                v-for="item in matchingData"
                :key="item.Id"
                :title="item.ProductName"
              >
                {{ item.ProductName }}
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <BottomInfo />
  </div>
</template>

<script>
import BottomInfo from "../components/BottomInfo";
import TopInfo from "../components/TopInfo";
import TopTabs from "../components/TopTabs";
export default {
  name: "MatchingDetail",
  data() {
    return {
      id: "",
      newData: {},
      matchingData: [],
      // isCollect: false,
    };
  },
  components: {
    TopInfo,
    TopTabs,
    BottomInfo,
  },
  mounted() {
    //console.log(this.$route.params);
    this.newData = this.$route.params;
    this.SetValue();
  },
  methods: {
    SetValue() {
      //console.log(value);
      // this.keywords = value;
      // this.searchArr = [];
      this.$axios({
        url: "/Policy/GetPolicyMate",
        method: "post",
        data: {
          entname: this.$cookies.get("MatchingKeyWords"),
          userdata: this.$cookies.get("userdata"),
        },
        transformRequest: [
          function (data) {
            let ret = "";
            for (let it in data) {
              ret +=
                encodeURIComponent(it) +
                "=" +
                encodeURIComponent(data[it]) +
                "&";
            }
            return ret;
          },
        ],
        headers: {
          "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
        },
      })
        .then((res) => {
          //console.log(res.data.data);
          this.matchingData = res.data.data;
        })
        .catch((err) => {
          //console.log(err);
        });
    },
    ToResourceDetail(item) {
      this.newData = item;
    },
  },
};
</script>

<style scoped>
.content {
  background-color: #f4f6fc;
  padding: 25px 0;
  min-height: 500px;
}
.news-content {
  width: 1200px;
  margin: 0 auto;
}
.header-info {
  padding: 30px;
  box-sizing: border-box;
  background: #ffffff;
  box-shadow: 0px 0px 9px 0px rgba(9, 90, 255, 0.05);
}
.header-title {
  font-weight: bold;
  color: #333;
  font-size: 32px;
}
.header-content {
  margin-top: 30px;
  overflow: hidden;
}
.content-info {
  width: 100%;
  background: #f6fafe;
  box-sizing: border-box;
  padding: 20px 30px;
  font-size: 16px;
  color: #333;
}
.content-info > div {
  line-height: 40px;
}
.content-info > div > i {
  margin-right: 10px;
  color: #095aff;
  float: left;
  position: relative;
  top: 11px;
  font-size: 18px;
}
.save i {
  color: #ffd34c;
  font-size: 30px;
  cursor: pointer;
}
.save {
  position: relative;
  top: 38px;
  right: 40px;
}
.bodyer-info {
  margin-top: 20px;
  overflow: hidden;
}
.lefter-info {
  width: 860px;
  min-height: 600px;
  background: #ffffff;
  box-shadow: 0px 0px 9px 0px rgba(9, 90, 255, 0.05);
  box-sizing: border-box;
  margin-bottom: 50px;
  padding: 30px;
  font-size: 18px;
  /* color: #333; */
}
.p-title {
  font-weight: bold;
  font-size: 20px;
  color: #333;
  position: relative;
  margin: 20px 0;
  padding-left: 15px;
  box-sizing: border-box;
}
.p-title::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 18px;
  background-color: #095aff;
  top: 7px;
  left: 0px;
}
.righter-info {
  width: 320px;
  min-height: 600px;
  background: #ffffff;
  box-shadow: 0px 0px 9px 0px rgba(9, 90, 255, 0.05);
  box-sizing: border-box;
  margin-bottom: 50px;
  padding: 10px 30px;
  color: #999999;
  font-size: 16px;
}
.news-list li {
  padding: 10px 0;
  border-top: 1px solid #dcdcdc;
  box-sizing: border-box;
  padding-left: 20px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-list li::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  width: 6px;
  height: 6px;
  background: #999999;
  border-radius: 50%;
}
</style>